import request from '@/config/axios'

//创建待办
export const createTodo = async (data) => {
  return await request.post({ url: '/countryside/pending/create', data })
}
//完成待办消息
export const completeTodo = async (id) => {
  return await request.put({ url: `/countryside/pending/complete?id=${id} ` })
}
//获得待办消息分页
export const getTodoPage = async (data) => {
  return await request.post({ url: '/countryside/pending/page', data })
}
//批量删除待办消息
export const deleteTodoList = async (params) => {
  return await request.delete({
    url: `/countryside/pending/delete`,
    params
  })
}
//获取各类型代办数量
export const getTodoNumber = () => {
  return request.get({ url: '/countryside/pending/get-type-number' })
}

//获得公告消息分页
export const getNoticePage = async (data) => {
  return await request.post({ url: '/countryside/announcement/page', data })
}
//获取公告消息详情
export const getNoticedetail = async (id) => {
  return await request.get({ url: '/countryside/announcement/get?id=' + id })
}

//获得登录用户信息
export const getUserInfo = () => {
  return request.get({ url: '/system/user/profile/get' })
}

//获得所有用户
export const getUserList = () => {
  return request.get({ url: '/system/user/list-all-simple' })
}

// 获取字典列表
export const getDictData = (params) => {
  return request.get({ url: '/system/dict-data/page',params })
}




// 上传文件
export const uploadFile = (data, params) => {
  return request.post({
    url: `/infra/file/upload`,
    data,
    params
  })
}